﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using LitTools;
namespace LitToolsTest
{
    public class ExampleScript : MonoBehaviour
    {
        [SerializeField] private Image img;
        [SerializeField] private Collider observableTarget;
        private void Awake()
        {
            //添加CollisionEnter事件
            observableTarget.AddCollisionEnter(OnCollisionEnterTest);
            //移除CollisionEnter事件
            //go.SubCollisionEnter(OnCollisionEnterTest);
            //清空CollisionEnter事件
            //go.ClearCollisionEnter();
            return;
            //img.OnPointerClick(p => { Debug.LogError("On Img Click"); });
            //img.OnPointerDown(p => { Debug.LogError("On Img Down"); });
            //img.OnPointerUp(p => { Debug.LogError("On Img Up"); });
            //img.OnPointerEnter(p => { Debug.LogError("On Img Enter"); });
            //img.OnPointerExit(p => { Debug.LogError("On Img Exit"); });
            //
            //go.OnMouseDown(() => { Debug.LogError("On Cube MouseDown"); });
            //go.OnMouseUp(() => { Debug.LogError("On Cube MouseUp"); });
            //go.OnMouseUpAsButton(() => { Debug.LogError("On Cube MouseUpAsButton"); });
            //go.OnMouseEnter(() => { Debug.LogError("On Cube MouseDown"); });
            //go.OnMouseExit(() => { Debug.LogError("On Cube MouseDown"); });
            //go.OnMouseOver(() => { Debug.LogError("On Cube Over"); });
            //
            //go.OnAwake(() => { Debug.LogError("GameObject Awake"); });
            //go.OnEnable(() => { Debug.LogError("GameObject Enable"); });
            //go.OnDisable(() => { Debug.LogError("GameObject Disable"); });
            //go.OnDestroy(() => { Debug.LogError("GameObject Destroy"); });
        }

        private void OnCollisionEnterTest(Collision col)
        {
            Debug.Log(col.gameObject.name);
        }
    }
}